{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib as mpl\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from datetime import date"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('0.24.2', '1.16.3', '3.0.3')"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.__version__,np.__version__, mpl.__version__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>date_of_birth</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>john</td>\n",
       "      <td>2000-01-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>mary</td>\n",
       "      <td>1999-12-20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>peter</td>\n",
       "      <td>2000-11-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>jeff</td>\n",
       "      <td>1995-02-25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>bill</td>\n",
       "      <td>1992-06-30</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    name date_of_birth\n",
       "0   john    2000-01-01\n",
       "1   mary    1999-12-20\n",
       "2  peter    2000-11-01\n",
       "3   jeff    1995-02-25\n",
       "4   bill    1992-06-30"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({\n",
    "    'name':[\n",
    "        'john','mary','peter','jeff','bill'\n",
    "    ],\n",
    "    'date_of_birth':[\n",
    "        '2000-01-01', '1999-12-20', '2000-11-01', '1995-02-25', '1992-06-30',\n",
    "    ],\n",
    "})\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RangeIndex(start=0, stop=5, step=1)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.index"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## use date column as index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000-01-01</th>\n",
       "      <td>john</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1999-12-20</th>\n",
       "      <td>mary</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-11-01</th>\n",
       "      <td>peter</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-02-25</th>\n",
       "      <td>jeff</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1992-06-30</th>\n",
       "      <td>bill</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             name\n",
       "2000-01-01   john\n",
       "1999-12-20   mary\n",
       "2000-11-01  peter\n",
       "1995-02-25   jeff\n",
       "1992-06-30   bill"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime_series = pd.to_datetime(df['date_of_birth'])\n",
    "\n",
    "datetime_index = pd.DatetimeIndex(datetime_series.values)\n",
    "\n",
    "df2=df.set_index(datetime_index)\n",
    "\n",
    "df2.drop('date_of_birth',axis=1,inplace=True)\n",
    "\n",
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2000-01-01', '1999-12-20', '2000-11-01', '1995-02-25',\n",
       "               '1992-06-30'],\n",
       "              dtype='datetime64[ns]', freq=None)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2.index"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## fill empty periods"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>year_born</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>john</td>\n",
       "      <td>2000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>mary</td>\n",
       "      <td>1999</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>peter</td>\n",
       "      <td>2001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>jeff</td>\n",
       "      <td>1995</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>bill</td>\n",
       "      <td>1992</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    name year_born\n",
       "0   john      2000\n",
       "1   mary      1999\n",
       "2  peter      2001\n",
       "3   jeff      1995\n",
       "4   bill      1992"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({\n",
    "    'name':[\n",
    "        'john','mary','peter','jeff','bill'\n",
    "    ],\n",
    "    'year_born':[\n",
    "        '2000', '1999', '2001', '1995', '1992',\n",
    "    ],\n",
    "})\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RangeIndex(start=0, stop=5, step=1)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1992-01-01</th>\n",
       "      <td>bill</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-01-01</th>\n",
       "      <td>jeff</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1999-01-01</th>\n",
       "      <td>mary</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-01</th>\n",
       "      <td>john</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-01-01</th>\n",
       "      <td>peter</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             name\n",
       "1992-01-01   bill\n",
       "1995-01-01   jeff\n",
       "1999-01-01   mary\n",
       "2000-01-01   john\n",
       "2001-01-01  peter"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime_series = pd.to_datetime(df['year_born'])\n",
    "\n",
    "datetime_index = pd.DatetimeIndex(datetime_series.values)\n",
    "\n",
    "df3=df.set_index(datetime_index)\n",
    "\n",
    "df3.drop('year_born',axis=1,inplace=True)\n",
    "\n",
    "df3.sort_index(inplace=True)\n",
    "\n",
    "df3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['1992-01-01', '1995-01-01', '1999-01-01', '2000-01-01',\n",
       "               '2001-01-01'],\n",
       "              dtype='datetime64[ns]', freq=None)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df3.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1992-01-01</th>\n",
       "      <td>bill</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1993-01-01</th>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1994-01-01</th>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-01-01</th>\n",
       "      <td>jeff</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1996-01-01</th>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1997-01-01</th>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1998-01-01</th>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1999-01-01</th>\n",
       "      <td>mary</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-01</th>\n",
       "      <td>john</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-01-01</th>\n",
       "      <td>peter</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             name\n",
       "1992-01-01   bill\n",
       "1993-01-01    NaN\n",
       "1994-01-01    NaN\n",
       "1995-01-01   jeff\n",
       "1996-01-01    NaN\n",
       "1997-01-01    NaN\n",
       "1998-01-01    NaN\n",
       "1999-01-01   mary\n",
       "2000-01-01   john\n",
       "2001-01-01  peter"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df4=df3.asfreq('YS')\n",
    "df4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['1992-01-01', '1993-01-01', '1994-01-01', '1995-01-01',\n",
       "               '1996-01-01', '1997-01-01', '1998-01-01', '1999-01-01',\n",
       "               '2000-01-01', '2001-01-01'],\n",
       "              dtype='datetime64[ns]', freq='AS-JAN')"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df4.index"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## lag columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>reading</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-01</th>\n",
       "      <td>58.720972</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-02</th>\n",
       "      <td>3.101846</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-03</th>\n",
       "      <td>84.729331</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-04</th>\n",
       "      <td>67.595894</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-05</th>\n",
       "      <td>82.898735</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-06</th>\n",
       "      <td>59.234635</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-07</th>\n",
       "      <td>43.735153</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-08</th>\n",
       "      <td>16.699276</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-09</th>\n",
       "      <td>31.154091</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-10</th>\n",
       "      <td>45.747997</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              reading\n",
       "2019-01-01  58.720972\n",
       "2019-01-02   3.101846\n",
       "2019-01-03  84.729331\n",
       "2019-01-04  67.595894\n",
       "2019-01-05  82.898735\n",
       "2019-01-06  59.234635\n",
       "2019-01-07  43.735153\n",
       "2019-01-08  16.699276\n",
       "2019-01-09  31.154091\n",
       "2019-01-10  45.747997"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame(\n",
    "    data={'reading': np.random.uniform(high=100,size=10)},\n",
    "    index=pd.to_datetime([date(2019,1,d) for d in range(1,11)])\n",
    ")\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['reading_d_minus_1']=df['reading'].shift(1,freq='D')\n",
    "\n",
    "df['reading_d_minus_2']=df['reading'].shift(2,freq='D')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>reading</th>\n",
       "      <th>reading_d_minus_1</th>\n",
       "      <th>reading_d_minus_2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-01</th>\n",
       "      <td>58.720972</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-02</th>\n",
       "      <td>3.101846</td>\n",
       "      <td>58.720972</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-03</th>\n",
       "      <td>84.729331</td>\n",
       "      <td>3.101846</td>\n",
       "      <td>58.720972</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-04</th>\n",
       "      <td>67.595894</td>\n",
       "      <td>84.729331</td>\n",
       "      <td>3.101846</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-05</th>\n",
       "      <td>82.898735</td>\n",
       "      <td>67.595894</td>\n",
       "      <td>84.729331</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-06</th>\n",
       "      <td>59.234635</td>\n",
       "      <td>82.898735</td>\n",
       "      <td>67.595894</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-07</th>\n",
       "      <td>43.735153</td>\n",
       "      <td>59.234635</td>\n",
       "      <td>82.898735</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-08</th>\n",
       "      <td>16.699276</td>\n",
       "      <td>43.735153</td>\n",
       "      <td>59.234635</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-09</th>\n",
       "      <td>31.154091</td>\n",
       "      <td>16.699276</td>\n",
       "      <td>43.735153</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-10</th>\n",
       "      <td>45.747997</td>\n",
       "      <td>31.154091</td>\n",
       "      <td>16.699276</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              reading  reading_d_minus_1  reading_d_minus_2\n",
       "2019-01-01  58.720972                NaN                NaN\n",
       "2019-01-02   3.101846          58.720972                NaN\n",
       "2019-01-03  84.729331           3.101846          58.720972\n",
       "2019-01-04  67.595894          84.729331           3.101846\n",
       "2019-01-05  82.898735          67.595894          84.729331\n",
       "2019-01-06  59.234635          82.898735          67.595894\n",
       "2019-01-07  43.735153          59.234635          82.898735\n",
       "2019-01-08  16.699276          43.735153          59.234635\n",
       "2019-01-09  31.154091          16.699276          43.735153\n",
       "2019-01-10  45.747997          31.154091          16.699276"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## plot data aggregated by day"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.indexes.datetimes.DatetimeIndex'>\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAx0AAAFvCAYAAAAv7KZwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xe8HGXd///XJwWSkIQScgcSCKGlEUCSCNhpfgFB5IYbkCZ4CyhKUUFRfyCg6I3c2LDdNypFerXATZGOgqIJASkJECUklIQ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YI/m0210aKXr7V18JElSlibZ4Ghdnz590vDhw1+cP3/+pBanr+yCJEmSpAz1scGxYuXj02L7wkaHJEmSpErZvUqSJEnqoJnjJ0yp5/ImzJo5vZ7LmzFjxoD9999/o4jgyiuv/Ptmm232enty++233wZf/vKXF0yZMuW1etZjo0OSJEnqYa644oo19thjj8VnnHHGM+3NLFu2jMsuu+yJKuqxe5UkSZKUgSVLlvTZbrvtNhk3btzETTfddLOf//znax5//PHrTpo0acKmm2662f7777/B8uXLueyyy1Y/++yzR5x33nnDt9lmm7EAO+2008abbbbZhE022WSzM888c+2mZQ4aNGirww8/fL1x48ZNvOWWWwZvvfXW4+68885B9a7dIx2SJElSBq6++uqh66yzztLbb799NsCiRYv6Llu2bMmZZ575DMCee+654aWXXrr6AQcc8OI999yzcPDgwW984xvfWABw0UUXzRkxYsQbL7/8cmy11VYTDzrooMXrrLPOG6+++mqfbbbZ5p8///nPnwQ46aSTKqm9S0c6ImKNiLgyImZFxMyIeE9ErBURN0XEY+XfNct5946IhyLiDxExrBy3cURcVo8NkSRJknqyyZMnv/qHP/xh6JFHHjnqhhtuGDxs2LA3rr/++iFbbLHF+LFjx068++67hzz44IMDW8p+5zvfGTFu3LiJU6ZMmTB//vz+Dz300ACAvn37cuihhy6uuvaudq/6IXBDSmk8sCUwE/gKcEtKaVPglvI+wNHAu4H/BQ4ox50GnNjFGiRJkqQeb4sttnj93nvvfXjzzTd/9aSTThp1/PHHr3vcccdtcPXVV//90Ucfffiggw567rXXXnvH5/trr712yB133DFk2rRpsx555JGHJ0yY8Oqrr77aB2CVVVZZ3q9f9Z2fOt3oiIjVgQ8CvwRIKf0rpfQC8DHg/HK284E9y9vLgVWBQcDSiPgAMD+l9Fhna5AkSZJ6izlz5vQfMmTI8s9+9rPPf/GLX5x/3333DQJYZ511lr344ot9rrnmmjVbyr3wwgt9V1999TeGDBmyfMaMGQPuv//+1VZu5V07p2NDYCFwbkRsCUwHjgVGpJSazpKfD4wob/8XcDPwNHAQcAXw8RWtICKOAI4AGD16dBdKlXqGBx6f2+gS1Eu570nS29X7ErftMX369IFf/epX1+vTpw/9+vVLP/3pT5+48sor15gwYcJmw4cPX7blllv+s6Xc3nvv/eLZZ589fKONNtpso402eq21+arUlUZHP2AycHRK6Z6I+CFvdaUCIKWUIiKVt28CbgKIiE8A1wFjI+J4YDFwbErplWb5s4GzAaZOneovQEqSJKnX2nvvvZfsvffeD9eO++AHP/jKWWed9XTzeb/3ve+9OW7gwIHpzjvvbLF30SuvvDKj9v5f/vKXR+pVb62unNPxJPBkSume8v6VFI2QBRGxLkD599naUEQMAg4FfgKcChwC/BE4sAu1SJIkSeqmOt3oSCnNB+ZFxLhy1I7Aw8DvKBoSlH9/2yz6JeCslNJSYCCQKM73qPv1gCVJkiQ1XldPVT8auCgiVgH+AXySoiFzeUR8CngC2Ldp5ogYCWydUjq1HPUj4K/AC7x1wrkkSZKkHqRLjY6U0n3A1BYm7djK/E8Du9Xcv4LihPLs7PvVjj90D1RQh6TeIecTuXOuXZJUH139nQ5JkiRJWiEbHZIkSZIqVf3PD1bEw/WSVib/50iSam1+/uZT6rm8Bw55oM3f/TjttNP+7Zxzzhn+3HPP9T/qqKPmf/vb357fkXV89KMf3fCRRx4ZeOCBBz538sknP9t2on6ybXRIjeKHz87zsZM6zteNpCa//OUvh998882Pbrzxxktbmr506VL69+/fYnbu3Ln97r///tXmzp37YKVFtsLuVZIkSVI3d8ABB4x+8sknV9111103PfXUU//tE5/4xGiAvffee8wBBxwweostthh/5JFHrrdkyZI+++yzz5jNN998woQJEyZeeOGFawDstNNOY5999tlVxo8fP/GGG24YfPfddw/ccsstx48dO3bihz/84Y0XLlzYd+nSpUyaNGnCtddeOwTgc5/73Kijjz56VD3q90iHJEmS3qbRR9gavf7u6OKLL557xx13rH7HHXc8esUVV6xeO+2ZZ55Z5d57753Vr18/jjrqqFHbb7/9kiuuuGLOc88913fq1KkT9thjjyXXXHPN7N13333TWbNmPQwwduzYid///vfn7rbbbi9//vOfH3nCCSeMPOecc+add955j++7774bL1u2bO6tt966+owZM2bWo34bHZIkSVLG9tprr8X9+hUf62+//fahN9544xpnnXXWOgCvv/56zJ49e5XVVlttedP8ixYt6vvSSy/13W233V4GOPzwwxfts88+GwFMnTr1tX333XfRfvvtt+mtt946c8CAAakeNdrokCRJkjI2ePDgNxsUKSWuvPLK2VtuueXrtfM88sgjq7R3eQ899NDAIUOGvDF//vz+wKv1qNFzOiRJkqQeYvvtt1/y3e9+d8Ty5UU75K677hrYfJ5hw4a9MXTo0DduuOGGwQC//OUvh73nPe95GeD8889fY/Hixf1uvfXWWccdd9zo5557rm896vJIR4PYV1GSVDXfa6TqtOcSt41w+umnP33EEUeMHj9+/MTly5fH+uuv//ptt902u/l855577uNHHnnkBsccc0yf0aNHv37JJZfMeeaZZ/qdfPLJ6918882PbLLJJksPO+ywZ4844oj1r7766jldrctGRy/lG5EkSSvme6W6m6eeeuoBgGOOOWYRsAjgqquumlM7z+DBg9PFF1/8RPPsuHHj/vXYY4891HT/ve9976v333//rObzzZkz581L6p544ol1+y0Pu1dJkiRJqpSNDkmSJEmVstEhSZIkqVKe0yGp3ezfLEmSOsNGhyStBDbYJPUm/s9Tc3avkiRJklQpj3RIkiRJHXXK6lPqu7wX6/K7H2edddawadOmrfarX/2qWx1u8kiHJEmSpErZ6JAkSZIy8dOf/nStzTfffML48eMnHnDAARssW7aMH/7wh8PGjBkzafPNN59w9913D26a96GHHlp1yy23HD927NiJxxxzzMhBgwZt1TTtpJNOGjFp0qQJY8eOnfiFL3xhZNV1271K2fHkNKnjfN1IK5evOVXh3nvvHXDllVeuNW3atFmrrrpqOuigg0b/7Gc/G3b66aePnD4eqGlVAAAgAElEQVR9+sy11lrrjfe+973jJk2a9ArAUUcdtf5nP/vZZz/96U8/f8YZZwxvWs7VV189dPbs2QP+9re/zUwpsdNOO21y/fXXD951111frqp2Gx2SJElSBm644YYhDz744KAtt9xyAsBrr73WZ9q0aYO33Xbbl0aOHLkMYK+99nr+0UcfHQAwY8aMwb///e9nAxx22GGLTjnllPXK5Qy98847h06cOHEiwCuvvNJn1qxZA2x0SJIkSb1cSin22WefRT/5yU+eahp3wQUXrHH11Vev0cHl8PnPf/6ZL33pS8/Vv8qWeU6HJEmSlIFddtllybXXXrvmU0891Q9gwYIFfbfZZptX7rnnniHz58/v+/rrr8evf/3rNZvmf9e73vXyeeedtybAOeecs1bT+F133XXJBRdcsPaLL77YB+Dxxx/v37TMqnikQ5IkSeqoOl3itiOmTJny2oknnvjUjjvuOHb58uX0798/nXXWWXNPOOGEp7fddtsJQ4YMeaPpfA6AH/3oR/MOPPDADf/7v/973R122GHJ4MGD3wDYa6+9ljz00EMD3v3ud48HGDRo0PKLLrro8VGjRi2rqnYbHZIkSVImDj/88MWHH3744tpxO+644z+PPfbYRc3nHTNmzNL77rtvVp8+fTj77LPXfOyxx1ZtmnbSSSc9e9JJJz27MmoGGx2SJEndjle/Uj3cddddg4499tjRKSWGDh36xnnnnTenUbXY6JAkSZJ6oF122eXlRx555OFG1wGeSC5JkiSpYjY6JEmSJFXKRockSZKkSnlOhyRJ6pY8mVrqOWx0SJIkSR005iv/N6Wey5tz+m6d+t2Pvffee8zuu+/+4ic/+cnFbc/dOHavkiRJknqwpUuXNroEGx2SJElSLn784x8PGzt27MRx48ZN3HPPPTcEuOOOOwZvtdVW49dbb73Nzz333DUBrr322iFTpkwZt8MOO2yy6aabTgI45ZRTRmy66aabbbrpppt94xvf+DeARx55ZJUNN9xws7333nvMmDFjJu2xxx4b/uY3vxkyefLk8RtssMGk2267bRDAkiVL+uyzzz5jNt988wkTJkyYeOGFF67RkbrtXiVJkiRlYNq0aQPOPPPMdf/0pz/NWnfddZctWLCg72c/+9n1FyxY0H/atGmz7rvvvgH//u//vklTV6uHH3540IwZMx4aP378v/7whz8Muvjii4dNnz59ZkqJKVOmTNhxxx1fWnvttd+YN2/egMsuu+wfU6ZMmbPFFltMuOiii4ZNmzZt1sUXX7zGt771rXW33377v3/ta19bd/vtt19yxRVXzHn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d+XUnpXRATFievrppRSef/+pmXXO1vmG/3/Ptt8zrXXKd/Q9wvVV9bdq4DnI2KfiHhzOyKiT0TsByw2X2k+59qhuFzgdimlDWuGjVJKGwILunk+59pzz3d13W++waWUlqWUjqC4CtGtFCcXm++e6+4J+aZsAq4r/zbdb9e3j13INvr/fc75nGuvR77R7xeqp9QNzmbv7ACMoTjEu5DiV14fLW9fBmxovrp8zrWX+c8BW7YyrT2/TtywfM61556vw7ovBHZpYfxhwFLz3XPdPST/C1q+gtPGwB+rypbzjSHv94uG5XOuvU75hr5fONR3yLp7Va2IGAaQUlpkfuXmc65dknq7iIjUyQ8DHc02+v99zvmca69HXvnLvXvVm1JKi1JKi6KTVyMw3/l8zrXXyjmfc+2553OuPfd8zrV3p3xnGhydzTb6/33O+Zxrr0e+SaPz6rwe0+ioMdV8w/I51557Pufac8/nXHvu+Zxrzz2fc+2553OuvSfk1Uk9sdHxrPmG5XOuPfd8zrXnns+59tzzOdeeez7n2nPP51x7T8irk3rMOR2SJEmSuqeeeKQDaHyfv96cz7n23PM51557Pufac8/nXHvu+fZko3v9mntW+Zxr7wl51VfWRzoi4182zj2fc+2553OuPfd8zrXnns+59tzzdVh3o3+NPdt8zrX3hLzqK/dGR7a/bJx7Pufac8/nXHvu+Zxrzz2fc+255+uw7kb/Gnu2+Zxr7wl51VnqBj8W0tkBeAwY3cq0eeary+dce+75nGvPPZ9z7bnnc64993wd1j2rhXFfB+4CHjPfPddt3qHeQ+7ndPwAWLOVaWeYrzSfc+2553OuPfd8zrXnns+59tzzXV33tIjYpXZESukbwLkUv1htvnuu27zqKuvuVZIkSZK6v36NLqCrImI88DFgVDnqKeB3KaWZ5qvN51x77vmca889n3Ptuedzrj33fM61557PufaekFf9ZN29KiJOAC6lOJntL+UQwCUR8RXz1eVzrj33fM61557Pufbc8znXnns+59pzz+dce0/Iq84afVJJVwbgUaB/C+NXoX0nGJnvZD7n2nPP51x77vmca889n3Ptuedzrj33fM6194S8Q32HrI90AMuBkS2MX7ecZr66fM61557Pufbc8znXnns+59pzz+dce+75nGvvCXnVUe7ndHweuCUiHgPmleNGA5sAR5mvNJ9z7bnnc64993zOteeez7n23PM51557Pufae0JedZT91asiog+wNW8/QeivKaU3zFebz7n23PM51557Pufac8/nXHvu+Zxrzz2fc+09Ia86anT/rnoPwBHmG5PPufbc8znXnns+59pzz+dce+75nGvPPZ9z7T0h79CFx77RBdR9g+Be843J51x77vmca889n3Ptuedzrj33fM61557PufaekHfo/JD7ieQtCfMNy+dce+75nGvPPZ9z7bnnc64993zOteeez7n2npBXJ2V/TkdzEbFeSulJ8ys/n3Ptuedzrj33fM61557Pufbc8znXnns+59p7Ql6dl32jIyI2AvYC1gfeoLgm88UppSXmq83nXHvu+Zxrzz2fc+2553OuPfd8zrXnns+59p6QV/1k3b0qIo4B/gcYALwbWJVip/pzRGxnvrp8zrXnns+59tzzOdeeez7n2nPP51x77vmca+8JedVZo08q6coAPAD0LW8PAm4vb48GZpivLp9z7bnnc64993zOteeez7n23PM51557Pufae0Leob5D1kc6Sk0/cLgqMBggpTQX6G++8nzOteeez7n23PM51557Pufac8/nXHvu+Zxr7wl51Unuv0j+C+CvEXEP8AHgOwARMRx43nyl+Zxrzz2fc+2553OuPfd8zrXnns+59tzzOdfeE/Kqo55wIvlmwATgwZTSLPMrL59z7bnnc64993zOteeez7n23PM51557Pufae0Je9ZN9o6M1ETE4pfSy+ZWfz7n23PM51557Pufac8/nXHvu+Zxrzz2fc+09Ia+O6wnndLTmYfMNy+dce+75nGvPPZ9z7bnnc64993zOteeez7n2npBXB2V9TkdEfLG1SZQnC5mvJp9z7bnnc64993zOteeez7n23PM51557Pufae0Je9ZX7kY5vA2sCQ5oNg2nftpnvfD7n2nPP51x77vmca889n3Ptuedzrj33fM6194S86il1g+v2dnYA7gamtDJtnvnq8jnXnns+59pzz+dce+75nGvPPZ9z7bnnc669J+Qd6js0vIAuFQ/jgOGtTBthvrp8zrXnns+59tzzOdeeez7n2nPP51x77vmca+8JeYf6Dj326lWSJEmSuoes+7NFxOoRcXpEzIqI5yNiUUTMLMetYb66fM61557Pufbc8znXnns+59pzz+dce+75nGvvCXnVV9aNDuByYDGwXUpprZTSMGD7ctzl5ivN51x77vmca889n3Ptuedzrj33fM61557PufaekFc9Nbp/V1cG4JHOTDPf9XzOteeez7n23PM51557Pufac8/nXHvu+Zxr7wl5h/oOuR/peCIivhwRI5pGRMSIiDgBmGe+0nzOteeez7n23PM51557Pufac8/nXHvu+Zxr7wl51VHujY79gGHAHRGxOCKeB24H1gL2NV9pPufac8/nXHvu+Zxrzz2fc+2553OuPfd8zrX3hLzqqdGHWro6AOOBnYDBzcbvYr7afM61557Pufbc8znXnns+59pzz+dce+75nGvvCXmH+g0NL6BLxcMxwCPAb4A5wMdqpt1rvrp8zrXnns+59tzzOdeeez7n2nPP51x77vmca+8JeYf6Dg0voEvFwwOULVdgDDANOLa8P8N8dfmca889n3Ptuedzrj33fM61557Pufbc8znX3hPyDvUd+pG3PimllwFSSnMiYjvgyojYAAjzleZzrj33fM61557Pufbc8znXnns+59pzz+dce0/Iq45yP5F8QUS8q+lOuWPtDqwNbG6+0nzOteeez7n23PM51557Pufac8/nXHvu+Zxr7wl51VNq8KGWrgzAesA6rexYZJUAAABcSURBVEx7n/nq8jnXnns+59pzz+dce+75nGvPPZ9z7bnnc669J+Qd6jtE+cBLkiRJUiVy714lSZIkqZuz0SFJkiSpUjY6JEmSJFXKRockSZKkStnokCRJklSp/x+nA7lcnTufuwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 864x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from datetime import date,datetime,timedelta\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib.ticker as mtick\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "np.random.seed(42)\n",
    "\n",
    "# create a dummy dataset\n",
    "df = pd.DataFrame(\n",
    "    index=pd.to_datetime(\n",
    "        [datetime(2019,1,1)+timedelta(hours=h+10*np.random.uniform()) for h in range(0,1000)]\n",
    "    ),\n",
    "    data={\n",
    "        'browser': np.random.choice([\n",
    "            'chrome',\n",
    "            'firefox',\n",
    "            'safari',\n",
    "            'edge'\n",
    "        ],size=1000,replace=True)\n",
    "    },\n",
    "    \n",
    ")\n",
    "\n",
    "print(type(df.index))\n",
    "# 'pandas.core.indexes.datetimes.DatetimeIndex'\n",
    "\n",
    "# just to make it more intuitive\n",
    "df.index.name= 'login_datetime'\n",
    "\n",
    "df.groupby(by=[lambda dt: dt.strftime('%Y-%m-%d'),'browser']).size().groupby(level=0).apply(\n",
    "    lambda x: 100 * x / x.sum()\n",
    ").unstack().plot(kind='bar',stacked=True,legend='reverse',width=0.8)\n",
    "\n",
    "current_handles, current_labels = plt.gca().get_legend_handles_labels()\n",
    "\n",
    "# sort or reorder the labels and handles\n",
    "reversed_handles = list(reversed(current_handles))\n",
    "reversed_labels = list(reversed(current_labels))\n",
    "\n",
    "# call plt.legend() with the new values\n",
    "plt.legend(reversed_handles,reversed_labels,loc='center left', bbox_to_anchor=(1, 0.5))\n",
    "plt.gca().yaxis.set_major_formatter(mtick.PercentFormatter())\n",
    "plt.gcf().set_size_inches(12,5)\n",
    "plt.title('Agreggated number of visits to website, per day and browser')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
